﻿using System.Windows.Controls;
using StrategyGame.Model;
using StrategyGame.Scripts;
using StrategyGameSilverlight.UserControls;

namespace StrategyGameSilverlight
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            PeopleManager.Initialize(0);
            for (int c = 0; c < 100; c++ )
                PeopleManager.AgeWorldByYear(0);

            double y = 0;
            foreach (Person person in PeopleManager.People)
            {
                PersonControl control = new PersonControl {DataContext = person};
                //LayoutRoot.Children.Add(control);
                //control.SetValue(Canvas.TopProperty, y);
                y += 50;
                LayoutRoot.Height = y;
            }
            FamilyTree.Person = PeopleManager.People[PeopleManager.People.Count-1];
        }
    }
}
